<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <p>1</p>
  <p>2</p>
  <p>3</p>
  <script>
    //1.复制数组
    const a=[1,2,[3,4]];
    const b=[...a]
    console.log(b);
    a[0]=3
    console.log(a,b);
    //2.合并数组
    const c=[1,2]
    const d=[3]
    const e=[4,5]
    console.log([...c,...d,...e]);
    console.log(0,...e,...c,...d);
    //3.字符串转化为数组
    console.log(...'alex');
    console.log([...'abcd']);
    //4.常见的类数组转化为数组
    function fun(){
      console.log([...arguments]);
    }
    fun(1,2,3)
    console.log([...document.querySelectorAll('p')]);
  </script>
</body>
</html>